// pages/talent/talent.js
const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    city: "",
    choseSort: false,
    choseSalary:false,
    talent:[
      { name: '张丹' },
      { name: '张丹' },
      { name: '张丹' },
      { name:'张丹'},
    ],
    According: false,
  },
  // 选择地址
  chose_city: function () {
    wx.navigateTo({
      url: '../address/address',
    })
  },
  //详情
  start_talentdeil(e){
    var id = e.currentTarget.dataset.id;
    app.navTo('../talentdeil/talentdeil?id'+id)
  },
  // 选择排序
  chose_Sort(){
    var choseSort = this.data.choseSort;
    this.setData({
      choseSort: !choseSort,
      choseSalary: false

    })
  },
  //薪酬排序
  chose_Salary(){
    var choseSalary = this.data.choseSalary;
    this.setData({
      choseSalary: !choseSalary,
      choseSort: false
    })
  },
  tochangehp(){
    var choseSort = this.data.choseSort;
    this.setData({
      choseSort: !choseSort,
    })
  },
  tochangehps() {
    var choseSalary = this.data.choseSalary;
    this.setData({
      choseSalary: !choseSalary,
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    //加载本页面的tabBar样式
    getApp().editTabBar();
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    let that = this
    if (!app.data.address.name) {
      wx.getLocation({
        type: 'gcj02',
        success: function (res) {
          console.log(res);
        },
      })
    }
    that.setData({
      city: app.data.address.name || "西安"
    })
    var HQgoods = that.data.talent;
    if (HQgoods.length == 0) {
      that.setData({
        According: true,
      })
    } else {
      that.setData({
        According: false,
      })
    }
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})